package cn.xuguowen.user.designPatten.chain_of_responsibility.hsp;

/**
 * ClassName: DepApprover
 * Package: cn.xuguowen.user.designPatten.chain_of_responsibility.hsp
 * Description: 部门主任审批
 *
 * @Author 徐国文
 * @Create 2023/6/2 22:02
 * @Version 1.0
 */
public class DepApprover extends Approver{

    public DepApprover(String name) {
        super(name);
    }

    @Override
    protected void approve(PurchaseRequest purchaseRequest) {
        if (purchaseRequest.getPrice() <= 5000) {
            System.out.println("购买编号ID为" + purchaseRequest.getId() + " 被"  + name + " 处理！");
        } else {
            this.approver.approve(purchaseRequest);
        }
    }
}
